let vue=new Vue({
   el:'.tab-content',
   data:{
       result:{}
   } ,
    methods:{
       select:function (pageNum,pageSize) {
           axios({
               url:`demand/index/${pageNum}/${pageSize}`,
           }).then(rs=>{
               this.result=rs.data.obj
           }).catch(error=>{
               layer.msg(error.message)
           })
       },
        toDetail:function (id) {
           layer.id=id;
            layer.open({
                type:2,
                title:false,
                area:['80%','80%'],
                content: 'demand/toDetail',
                end:()=>{
            }
            })
        },
        toUpdate:function (id) {
           layer.message='';
            layer.uid=id;
            layer.open({
                type: 2,
                title: false,
                area: ['80%','80%'],
                content:'demand/toUpdate',
                end:()=>{
                    if (layer.message!=''){
                        layer.msg(layer.message);
                        this.select(1,4)
                    }
                }
            })
        }
    },
    created:function () {
        this.select(1,4)
    }
});